package ch.headshot.photomap.mapper;

import java.io.File;

import javax.xml.bind.JAXB;

import primer.po.GpxType;
import primer.po.WptType;

public class Mapper {

	public static void main(String[] args) {
		// File gpxInput = new File(args[0]);
		// File imageDir = new File(args[1]);
		// File gpxOutput = new File(args[2]);
		File gpxInput = new File(args[0]);
		File imageDir = new File("C:/remote/Dokumente/Martin/privat/bilder/Archiv/2007 Rhonewanderung");
		File gpxOutput = new File(args[0] + "2");
		MapperStrategy strategy = new MapperStrategy(gpxInput, 110);
		GpxType gpx = new GpxType();
		for (File image : imageDir.listFiles()) {
			WptType wpt = strategy.createWptForImage(image);
			if (wpt != null) {
				gpx.getWpt().add(wpt);
			}

		}

		JAXB.marshal(gpx, new File(args[0] + 2));
	}

}
